//
//  RBSearchResultGoodsCell.m
//  zhongzhenglu
//
//  Created by 马军凯 on 2023/5/4.
//

#import "RBSearchResultGoodsCell.h"
#import "RBSearchResultResponse.h"

@interface RBSearchResultGoodsCell ()

//图片
@property (weak, nonatomic) IBOutlet UIImageView *picImageView;
//标题
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
//价格
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
//销量
@property (weak, nonatomic) IBOutlet UILabel *saleNumLabel;

@end

@implementation RBSearchResultGoodsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

//
- (void)setCellModel:(RBCellModel *)cellModel {
    RBSearchResultModel *model = cellModel.cellData;
    //图片
    [self.picImageView setImageWithUrl:model.picurl placeHolder:nil];
    //
    self.titleLabel.text = model.good_name;
    //
    self.priceLabel.attributedText = [NSString changeSectionFontWithString:[NSString stringWithFormat:@"¥%@", model.sell_price] font:[UIFont systemFontOfSize:11] from:0 lenth:1];
    //
    self.saleNumLabel.text = [NSString stringWithFormat:@"销量:%@", model.sell_number];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
